/**
 * Main Dr.Doom Management System Class
 * 
 *  This class is the entry point of the system. From here we will 
 *  make a presenter for the login, and initiate the program. 
 */
package edu.gatech.volt2.drdoommgt.system;

import javax.swing.JOptionPane;

import java.util.Date;
import java.util.List;
import java.util.Timer;
import java.util.logging.Level;
import java.util.logging.Logger;

import javax.persistence.NoResultException;
import javax.persistence.Query;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;

import edu.gatech.volt2.drdoommgt.domain.*;
import edu.gatech.volt2.drdoommgt.gui.*;
import edu.gatech.volt2.drdoommgt.presenter.*;

public class Main {

	/**
	 * Main launch point
	 * @param args
	 */
	
    private static Logger myLogger = Logger.getLogger("edu.gatech.volt2.drdoommgt.system.Main");

    private static DataBaseAccessor dba;
    
	public static void main(String[] args)
	{
		
		//DataBaseAccessor db = new DataBaseAccessor();

		//DoctorPresenter
		
		LoginPresenter pres = new LoginPresenter();
		//TreatmentRecordPresenter pres = new TreatmentRecordPresenter(dba);

		
		//db.connectToDatabase();
		//Patient p = db.findPatientByEmail("patient@gmail.com");
		//PatientHealthHistoryPresenter pres = new PatientHealthHistoryPresenter(p);
		
		//PatientPresenter pres = new PatientPresenter(new Patient(), new PatientWindow() );
		//SysAdminPresenter log = new SysAdminPresenter(null, new DataBaseAccessor());
		//NursePresenter pres = new NursePresenter(new Nurse(), new NurseWindow());
		//SysAdminPresenter pres = new SysAdminPresenter(new SysAdmin(), new SysAdminWindow() );
		//DoctorPresenter pres = new DoctorPresenter(new Doctor(), db );
		//FindByNamePresenter pres= new FindByNamePresenter(new NameWindow());

//		myLogger.log(Level.INFO, "Starting Up!");
//		dba= new DataBaseAccessor();
//		dba.connectToDatabase();
//		
//		create();
//		User a= dba.findByEmail();
//		Login log1= new Login(a);
//		log1.loginProcess(a);
//		
//		dba.saveUser(a);
//		
//		Patient a= dba.findPatientByEmail("lincolnrider97@yahoo.com");
//		System.out.println(a.getId());
	}
	
	public static void create()
	{
//
//		//Patient newUser = new Patient(new Name(JOptionPane.showInputDialog("Enter first name"), JOptionPane.showInputDialog("Enter last name.")));
//		Patient newUser = new Patient(new Name("Test", "Patient"));
//		PatientInfo pi= new PatientInfo("male", null, null, new ContactInfo("111-111-1111","111-111-1111","111-111-1111","patient@gmail.com"),
//				new Address("1419 Collins Dr.", null, "Augusta", "Georgia", "30907"), null);
//		//newUser.setEmail(JOptionPane.showInputDialog("Enter email address."));
//		newUser.setEmail("patient@gmail.com");
//
//		//newUser.setPassword(JOptionpane.showInputDialog("Enter desired password."));
//		newUser.setPassword("patient");
//
//		boolean created= dba.createUser(newUser);
//
//		while(!created)
//		{
//			newUser.setEmail(JOptionPane.showInputDialog("email address already in use. choose another."));
//			created= dba.createUser(newUser);
//		}	
	}

	
}
